package com.cf.module.app;


import android.annotation.SuppressLint;
import android.content.Context;

import com.alibaba.android.arouter.launcher.ARouter;
import com.cf.base.comm.base.BaseApplication;
import com.cf.base.comm.tools.InitComm;
import com.cf.base.comm.widget.watermark.WatermarkUtils;
import com.cf.base.sp.SpCore;

/**
 * @author yangji
 */
public class MyApplication extends BaseApplication {

    @SuppressLint("StaticFieldLeak")
    private static Context context;

    public static Context getContext() {
        return context;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        context = this;
        if (BuildConfig.DEBUG) {
            ARouter.openLog();
            ARouter.openDebug();
        }

        //配置全局 Http 请求
        HttpConfig.init();

        ARouter.init(this);

        SpCore.init(this).build();

        WatermarkUtils.singleton.get().init(this);

        WatermarkUtils.singleton.get()
                .setWatermarkText(SpCore.getUser("watermark", "没有获取到水印"))
                .setTextSize(20)
                .setTextColor(0x20ff0000)
                .update();
    }

}
